***creating different Fracmil definitions for instruments
clear
set more off

******************************************************
 ***READ In Long Datasets
	use GvtDataCBSA.dta
	 keep if year<2014 & year>2001
		**About 940 unique cbsas
	bysort year: egen spend_nat = sum(Spending)
	bysort year: egen oblig_nat = sum(dollars)
	
sort cbsa year

bysort cbsa: egen temp = mean(Spending)
bysort cbsa: egen temp2 = mean(spend_nat)
gen fracmilNS = temp/temp2
bysort cbsa: egen tempOB = mean(dollars)
bysort cbsa: egen tempOB2 = mean(oblig_nat)
gen fracmilOBNS = tempOB/tempOB2

*Now create wide Dataset.  Keep any year
keep if year==2006
keep cbsa fracmil*

save fracmilCBSA, replace

